//
//  UILableTool.m
//  MYIOSFP
//
//  Created by mobileteam on 13-9-30.
//  Copyright (c) 2013年 陈 靓. All rights reserved.
//

#import "UILableTool.h"

@implementation UILableTool

//动态计算Label高度
+(UILabel *)getFeedBackLabel:(NSString *)textStr
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];
    //设置自动行数与字符换行，为0标示无限制
    [label setNumberOfLines:0];
    label.lineBreakMode = NSLineBreakByWordWrapping;//换行方式
    UIFont *font = [UIFont fontWithName:@"Arial" size:16];
    label.backgroundColor = [UIColor clearColor];
    label.font = font;
    CGSize size = CGSizeMake(310,CGFLOAT_MAX);
    CGSize labelsize = [textStr sizeWithFont:font constrainedToSize:size lineBreakMode:label.lineBreakMode];
    label.frame = CGRectMake(5,30, labelsize.width, labelsize.height);
    label.text = textStr;
    return label;
}

@end
